//
//  DeviceManagerHelper.m
//  Router
//
//  Created by teki on 15/10/27.
//  Copyright © 2015年 dc. All rights reserved.
//

#import "DeviceManagerHelper.h"

@implementation DeviceManagerHelper
- (void)getConnectedDeviceListWithDeviceID:(NSString *)deviceID user:(NSString *)user success:(RequestSussess)success failure:(RequestFailure)failure
{
    NSDictionary *param = @{@"deviceID":deviceID,
                            @"user":user};
    [self.requestOperator requestPostWithURL:Device_Connected_List_POST_URL params:param success:^(BOOL succ, id responseObject) {
        success(YES,responseObject,nil);
    } failure:failure];
}



- (void)addToBlackListByMacWithDeviceID:(NSString *)deviceID mac:(NSString *)macAddr hostName:(NSString *)hostname success:(RequestSussess)success failure:(RequestFailure)failure
{
    NSDictionary *param = @{@"deviceID":deviceID,
                            @"mac":macAddr,
                            @"hostName":hostname};
    [self.requestOperator requestPostWithURL:Device_AddToBlackListByMAC_POST_URL params:param success:^(BOOL succ, id responseObject) {
        success(YES,responseObject,nil);
    } failure:failure];
}



- (void)getBlackListByDeviceID:(NSString *)deviceID user:(NSString *)user success:(RequestSussess)success failure:(RequestFailure)failure
{
    NSDictionary *param = @{@"deviceID":deviceID,
                            @"user":user};
    [self.requestOperator requestPostWithURL:Device_BlackListByDeviceID_POST_URL params:param success:^(BOOL succ, id responseObject) {
        success(YES,responseObject,nil);
    } failure:failure];
}


- (void)deleteFromBlackListWithDeviceID:(NSString *)deviceID mac:(NSString *)macAddr success:(RequestSussess)success failure:(RequestFailure)failure
{
    NSDictionary *param = @{@"deviceID":deviceID,
                            @"mac":macAddr};
    [self.requestOperator requestPostWithURL:Device_DeleteFromBlackListByMac_POST_URL params:param success:^(BOOL succ, id responseObject) {
        success(YES,responseObject,nil);
    } failure:failure];
}
@end
